<template>
	<view class="p20">
		<!-- 		<view class="radius20 p30 mb20 bg-fff flex" @click="$u.route('/pages/index/selectIdentity/selectIdentity')">
			<view class="color-999 flex1">切换身份</view>
			<view class="" v-if="$user.identity">当前{{$list('identity')[$user.identity]}}</view>
			<u-icon name="arrow-right" class="ml10 pe-none" />
		</view> -->
		<view class="radius20 bg-fff pl30 pr30 mb20"> 
			<view class="pt30 pb30 flex row-between border-b" @click="$u.route('/pages/my/bindMobile/bindMobile')">
				<view class="">修改手机号</view>
				<u-icon name="arrow-right" class="ml10 pe-none" />
			</view>
			<view class="pt30 pb30 flex row-between border-b" @click="$u.route('/pages/my/bindMobile/psd-edit')">
				<view class="">修改登录密码</view>
				<u-icon name="arrow-right" class="ml10 pe-none" />
			</view>
		</view>
		<view class="radius20 p30 mb20 bg-fff flex" @click="update">
			<view class="fs30 pr flex1 ">
				<text>检查更新</text>
				<u-badge size="mini" v-if="isUp" type="error" count='1' is-center is-dot></u-badge>
			</view>
			<view class=" text-right" v-if="!isUp">已最新</view>
			<u-icon name='arrow-right' color="#999999" />
		</view>
		<view class="radius20 p30 mb20 bg-fff flex"
			@click="$u.route('/pages/public/text',{text:'service_agreement',tit:'服务协议'})">
			<view class="flex1">服务协议</view>
			<u-icon name="arrow-right" class="ml10 pe-none" />
		</view>
		<view class="radius20 p30 mb20 bg-fff flex"
			@click="$u.route('/pages/public/text',{text:'privacy_policy',tit:'隐私政策'})">
			<view class="flex1">隐私政策</view>
			<u-icon name="arrow-right" class="ml10 pe-none" />
		</view>
		<view class="radius20 p30 mb20 bg-fff flex"
			@click="$u.route('/pages/public/text',{text:'about_us',tit:'关于我们'})">
			<view class="flex1">关于我们</view>
			<u-icon name="arrow-right" class="ml10 pe-none" />
		</view>

		<!-- #ifndef MP-WEIXIN -->
		<view class="h120"></view>
		<view class="pf bottom0 left0  w-max">
			<view class="p20">
				<u-button type="warning" ripple @click="$logOut">退出登录</u-button>
			</view>
		</view>
		<!-- #endif -->
	</view>
</template>

<script>
	import update from '@/common/update.js'
	export default {
		data() {
			return {
				isUp: false,
			}
		},
		onLoad() {
			uni.$once('update', data => {
				if (data.data.code == 200) this.isUp = true
			})
			update(this.$baseUrl, false)
		},
		onUnload() {
			uni.$off('update')
		},
		methods: {
			update() {
				console.log('更新');
				// #ifndef APP-PLUS
				this.$msg('已是最新版本')
				return
				// #endif
				uni.$once('update', data => {
					console.log(data);
					if (data.data.code != 200) { //不等于200 则不更新
						this.$msg('已是最新版本')
					}
				})
				update(this.$baseUrl)
			}
		}
	}
</script>

<style lang="scss">

</style>
